#include "Core.h"


__BEGIN_NAMESPACE

#if PLATFORM==PLATFORM_WINDOWS
static LARGE_INTEGER s_CPUFrequency = {0,0};

class CPUInitial {
public:
	CPUInitial() {
		::QueryPerformanceFrequency(&s_CPUFrequency);
	}
	~CPUInitial() {}
};

static CPUInitial s_CPUInitial;

dword GetMilliSec(void) {
#if PLATFORM == PLATFORM_WINDOWS
	return ::GetTickCount();
#else
#endif
}

qword GetMicroSec(void) {
	LARGE_INTEGER Counter;
	::QueryPerformanceCounter(&Counter);
	return 1000 * Counter.QuadPart/s_CPUFrequency.QuadPart;
}

qword GetCpuCycle(void) {
	LARGE_INTEGER Counter;
	::QueryPerformanceCounter(&Counter);
	return Counter.QuadPart;
}

qword GetCpuFrequency(void) {
	return s_CPUFrequency.QuadPart;
}
#else


#endif

__END_NAMESPACE
